package org.ix.shiro.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.Min;
import javax.validation.constraints.Size;
import java.util.HashSet;
import java.util.Set;

@Component
@ConfigurationProperties(prefix = "ix.auth")
@Setter
@Getter
@Validated
public class AuthProperties {

    /**
     * 是否关闭验证
     */
    private boolean close = false;

    /**
     * jwt加密key
     */
    @Size(min = 64, max = 256)
    private String tokenSecretKey;

    /**
     * jwt过期时长
     */
    @Min(3600)
    private int tokenExpireSecond;

    /**
     * 匿名路径
     */
    private Set<String> anonymousUrls = new HashSet<>();
}
